home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / scnsrv.zip / NEWNOV.H < prev    next >
Text File  |  1992-10-23  |  5KB  |  200 lines

  1. #ifndef _H_NOVELL
  2. #define _H_NOVELL
  3.  
  4. #define NOVELL_N_DRIVES    32                // number of Netware drives, including temps
  5.  
  6. #define GDH_MASK(x) ((x)&0xFF00)
  7. #define GDH_HANDLE(x) ((x)&0xFF)
  8.  
  9. #define GDH_UNMAPPED    0x0000            // Get Dir Handle: drive is unmapped
  10. #define GDH_MAP_PERM    0x0100            // Get Dir Handle: permanent mapping
  11. #define GDH_MAP_TEMP    0x0200            // Get Dir Handle: temporary mapping
  12. #define GDH_LOCAL        0x8000            // Get Dir Handle: local drive.
  13.  
  14. #define ADH_PERM        0x12                // Allocate dir handle: perm op code
  15. #define ADH_TEMP        0x13                // Allocate dir handle: temp op code
  16. #define ADH_DEALLOC    0x14                // Allocate dir handle: deallocate!
  17.  
  18. #define NERR_NOVOL    0x98                // volume does not exist
  19. #define NERR_BADDH    0x9B                // bad directory handle
  20. #define NERR_BADPATH    0x9C                // invalid path
  21. #define NERR_NODRIVE    0xF7                // drive doesn't exist
  22. #define NERR_NOPATH    0xFF                // path no locatable
  23. #define NERR_BINDLOK    0xFE                // bindery locked
  24. #define NERR_NOCONN    0xF8                // no connection to fileserver
  25.  
  26.  
  27. #define BYTE unsigned char
  28. #define WORD unsigned int
  29. #define LONG unsigned long
  30. #define DROW unsigned int                // backwards (swapped-byte) WORD
  31. #define GNOL unsigned long                // backwards LONG
  32.  
  33. struct GetDirectoryPathRequest {        // 0xE2 01
  34.     WORD length;
  35.     BYTE reqFcnCode;                        // s/b = 1
  36.     BYTE dirHandle;
  37. };
  38.  
  39. struct GetDirectoryPathReply {
  40.     DROW length;                            // minus two... hi-lo, not low/hi
  41.     BYTE dirPathLen;
  42.     BYTE path[255];
  43. };
  44.  
  45. struct GetVolumeNameRequest {
  46.     WORD length;
  47.     BYTE function;                            // s/b 06
  48.     BYTE volNumber;
  49. };
  50.  
  51. struct GetVolumeNameReply {
  52.     WORD length;
  53.     BYTE volnameLength;
  54.     BYTE volName[16];
  55. };
  56.  
  57. struct AllocateDirHandleRequest {
  58.     WORD length;                            // sizeof (this struct) - 2
  59.     BYTE reqFcnCode;                        // 0x12 for permanent 0x13 for temporary
  60.     BYTE dirHandle;
  61.     BYTE driveLetter;
  62.     BYTE pathLength;
  63.     BYTE path[255];
  64. };
  65.  
  66. struct NovellReply {
  67.     WORD length;                            // minus two, of course
  68.     BYTE newDirHandle;
  69.     BYTE effRightsMask;
  70. };
  71.  
  72.  
  73. struct ConnectionIDTable {
  74.  
  75.     BYTE slotInUse;
  76.     BYTE serverOrderNumber;
  77.     BYTE serverNetAddr[4];
  78.     BYTE physicalNodeAddr[6];
  79.     BYTE socketNumber[2];
  80.     BYTE receiveTimeout[2];
  81.     BYTE routerPNA[6];
  82.     BYTE packetSequenceNumber;
  83.     BYTE connectionNumber;
  84.     BYTE connectionStatus;
  85.     BYTE maxTimeout[2];
  86.     BYTE filler[5];
  87.  
  88. };
  89.  
  90. struct DriveConnectionIDTable {
  91.     BYTE connID[NOVELL_N_DRIVES];
  92. };
  93.  
  94. struct FileServerNameTable {
  95.     BYTE ServerName[8][48];
  96. };
  97.  
  98. // Get File Info
  99. struct NovellFileInfo {
  100.     BYTE filename[14];
  101.     DROW seqnum;
  102.     BYTE fileAttributes;
  103.     BYTE extendedFileAttributes;
  104.     WORD creationDate;
  105.     WORD accessDate;
  106.     LONG updateTime;
  107.     LONG ownerID;
  108.     LONG archiveTime;
  109.     LONG fileSize;
  110.     BYTE reserved_buf[56];
  111. };
  112.  
  113. struct GetFileInfoRequest {
  114.     WORD length;                        // minus two, of course
  115.     BYTE function;                        // s/b 0x0F
  116.     DROW seqnum;
  117.     BYTE dirHandle;
  118.     BYTE searchAttribs;
  119.     BYTE pathLen;
  120.     BYTE path[255];
  121. };
  122.  
  123. struct GetFileInfoReply {
  124.     WORD length;                        // minus two
  125.     DROW seqnum;
  126.     BYTE filename[14];
  127.     BYTE fileAttributes;
  128.     BYTE extendedFileAttributes;
  129.     GNOL fileSize;
  130.     WORD creationDate;
  131.     WORD accessDate;
  132.     LONG updateTime;
  133.     GNOL ownerID;
  134.     LONG archiveTime;
  135.     BYTE reserved_buf[56];
  136. };
  137.  
  138. struct ScanDirInfoRequest {
  139.     WORD length;                        // minus two, of course
  140.     BYTE function;                        // s/b 0x02
  141.     BYTE dirHandle;
  142.     WORD subdirNumber;                // start with zero, then increment on repeat
  143.     BYTE pathLen;
  144.     BYTE path[255];
  145. };
  146.  
  147. struct ScanDirInfoReply {
  148.     WORD length;                        // minus two
  149.     BYTE filename[16];
  150.     GNOL creationDate;
  151.     GNOL ownerID;
  152.     BYTE rightsMask;
  153.     BYTE reserved;
  154.     WORD subdirNumber;
  155. };
  156.  
  157. // Set File Info
  158. struct SetFileInfoRequest {
  159.     WORD length;                        // minus two, of course
  160.     BYTE function;                        // s/b 0x10
  161.     BYTE fileAttributes;
  162.     BYTE extendedFileAttributes;
  163.     GNOL reserved;
  164.     WORD creationDate;
  165.     WORD accessDate;
  166.     LONG updateTime;
  167.     GNOL ownerID;
  168.     LONG archiveTime;
  169.     BYTE reserved_buf[56];
  170.     BYTE dirHandle;
  171.     BYTE searchAttribs;
  172.     BYTE pathLen;
  173.     BYTE path[255];
  174. };
  175.  
  176. // Procedure decl's
  177. int GetDirectoryHandle(int driveNumber);
  178. int GetPreferredConnectionID(void);
  179. void SetPreferredConnectionID(int connectionID);
  180. struct ConnectionIDTable far *GetConnIDTable(void);
  181. struct FileServerNameTable far *GetFSNameTable(void);
  182. int GetConnectionID(char *serverName, int *connectionID);
  183. int FindMappedDrive(char *serverName, char *volumeName, char *path);
  184. int AllocateDirHandle(char *volumeName, int drive, int handle, int opcode);
  185. int GetDirectoryPath(int dirHandle, char *pathOutBuf);
  186. void DumpDriveMapping(void);
  187. int NovMapDrive(int *drive, char *server, char *volume);
  188. int NovUnMapDrive(int drive, char *server);
  189. int SetFileInfo(char *path, struct NovellFileInfo *nfip);
  190. int GetFileInfo(char *path, struct NovellFileInfo *nfip, int seqnum);
  191. int GetDirInfo(char *path, struct ScanDirInfoReply *dip);
  192. int GetNextServer(char *serverName, int *connectionIDP);
  193. int GetVolumeName(char *volName, int volIndex);
  194. unsigned int IntSwap(unsigned int t);
  195. unsigned long LongSwap(unsigned long t);
  196.  
  197. #endif
  198.  
  199.  
  200.